﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Diagnostics;

namespace KeyboardImageViewer
{
    /// <summary>
    /// Interaction logic for ApplyUpdateConfirmation.xaml
    /// </summary>
    public partial class ApplyUpdateConfirmation : Window
    {
        private string changelogLinkString;

        public ApplyUpdateConfirmation()
        {
            InitializeComponent();

            this.changelogLinkString = ImageManager.Config.GetConfigString("UpdateChangelogLocation");
        }

        private void yesButton_Click(object sender, RoutedEventArgs e)
        {
            UpdateHandler.ApplyUpdate();

            this.Close();
        }

        private void disableUpdatesButton_Click(object sender, RoutedEventArgs e)
        {
            ImageManager.Config.UpdatesEnabled = false;

            this.Close();
        }

        private void changelogLink_Click(object sender, RoutedEventArgs e)
        {
            Process.Start(this.changelogLinkString);
        }
    }
}
